// Upgrade NOTE: commented out 'float4 unity_LightmapST', a built-in variable
// Upgrade NOTE: commented out 'float4x4 _World2Object', a built-in variable
// Upgrade NOTE: commented out 'sampler2D unity_Lightmap', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced tex2D unity_Lightmap with UNITY_SAMPLE_TEX2D

Shader "Mobile/VertexLit" {
Properties {
 _MainTex ("Base (RGB)", 2D) = "white" { }
}
SubShader { 
 LOD 80
 Tags { "RenderType"="Opaque" }
 Pass {
  Tags { "LIGHTMODE"="Vertex" "RenderType"="Opaque" }
  GpuProgramID 121265
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 UNITY_MATRIX_IT_MV;
//uniform float4 glstate_lightmodel_ambient;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 lcolor_1;
    float3 eyeNormal_2;
    float4 color_3;
    float3x3 tmpvar_4;
    tmpvar_4[0] = conv_mxt4x4_0(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_4[1] = conv_mxt4x4_1(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_4[2] = conv_mxt4x4_2(UNITY_MATRIX_IT_MV).xyz;
    float3 tmpvar_5;
    tmpvar_5 = normalize(mul(tmpvar_4, in_v.normal));
    eyeNormal_2 = tmpvar_5;
    float3 tmpvar_6;
    tmpvar_6 = glstate_lightmodel_ambient.xyz;
    lcolor_1 = tmpvar_6;
    float3 tmpvar_7;
    tmpvar_7 = unity_LightPosition[0].xyz;
    float3 dirToLight_8;
    dirToLight_8 = tmpvar_7;
    float _tmp_dvx_116 = max(dot(eyeNormal_2, dirToLight_8), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_116, _tmp_dvx_116, _tmp_dvx_116) * unity_LightColor[0].xyz) * 0.5), float3(1, 1, 1)));
    float3 tmpvar_9;
    tmpvar_9 = unity_LightPosition[1].xyz;
    float3 dirToLight_10;
    dirToLight_10 = tmpvar_9;
    float _tmp_dvx_117 = max(dot(eyeNormal_2, dirToLight_10), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_117, _tmp_dvx_117, _tmp_dvx_117) * unity_LightColor[1].xyz) * 0.5), float3(1, 1, 1)));
    float3 tmpvar_11;
    tmpvar_11 = unity_LightPosition[2].xyz;
    float3 dirToLight_12;
    dirToLight_12 = tmpvar_11;
    float _tmp_dvx_118 = max(dot(eyeNormal_2, dirToLight_12), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_118, _tmp_dvx_118, _tmp_dvx_118) * unity_LightColor[2].xyz) * 0.5), float3(1, 1, 1)));
    float3 tmpvar_13;
    tmpvar_13 = unity_LightPosition[3].xyz;
    float3 dirToLight_14;
    dirToLight_14 = tmpvar_13;
    float _tmp_dvx_119 = max(dot(eyeNormal_2, dirToLight_14), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_119, _tmp_dvx_119, _tmp_dvx_119) * unity_LightColor[3].xyz) * 0.5), float3(1, 1, 1)));
    float3 tmpvar_15;
    tmpvar_15 = unity_LightPosition[4].xyz;
    float3 dirToLight_16;
    dirToLight_16 = tmpvar_15;
    float _tmp_dvx_120 = max(dot(eyeNormal_2, dirToLight_16), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_120, _tmp_dvx_120, _tmp_dvx_120) * unity_LightColor[4].xyz) * 0.5), float3(1, 1, 1)));
    float3 tmpvar_17;
    tmpvar_17 = unity_LightPosition[5].xyz;
    float3 dirToLight_18;
    dirToLight_18 = tmpvar_17;
    float _tmp_dvx_121 = max(dot(eyeNormal_2, dirToLight_18), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_121, _tmp_dvx_121, _tmp_dvx_121) * unity_LightColor[5].xyz) * 0.5), float3(1, 1, 1)));
    float3 tmpvar_19;
    tmpvar_19 = unity_LightPosition[6].xyz;
    float3 dirToLight_20;
    dirToLight_20 = tmpvar_19;
    float _tmp_dvx_122 = max(dot(eyeNormal_2, dirToLight_20), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_122, _tmp_dvx_122, _tmp_dvx_122) * unity_LightColor[6].xyz) * 0.5), float3(1, 1, 1)));
    float3 tmpvar_21;
    tmpvar_21 = unity_LightPosition[7].xyz;
    float3 dirToLight_22;
    dirToLight_22 = tmpvar_21;
    float _tmp_dvx_123 = max(dot(eyeNormal_2, dirToLight_22), 0);
    lcolor_1 = (lcolor_1 + min(((float3(_tmp_dvx_123, _tmp_dvx_123, _tmp_dvx_123) * unity_LightColor[7].xyz) * 0.5), float3(1, 1, 1)));
    color_3.xyz = float3(lcolor_1);
    color_3.w = 1;
    float4 tmpvar_23;
    float4 tmpvar_24;
    tmpvar_24 = clamp(color_3, 0, 1);
    tmpvar_23 = tmpvar_24;
    float4 tmpvar_25;
    tmpvar_25.w = 1;
    tmpvar_25.xyz = in_v.vertex.xyz;
    out_v.xlv_COLOR0 = tmpvar_23;
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.vertex = UnityObjectToClipPos(tmpvar_25);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 col_1;
    col_1.xyz = (tex2D(_MainTex, in_f.xlv_TEXCOORD0) * in_f.xlv_COLOR0).xyz;
    col_1.xyz = (col_1 * 2).xyz;
    col_1.w = 1;
    out_f.color = col_1;
    return out_f;
}


ENDCG

}
 Pass {
  Tags { "LIGHTMODE"="VertexLM" "RenderType"="Opaque" }
  GpuProgramID 194227
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
// uniform float4 unity_LightmapST;
uniform float4 _MainTex_ST;
// uniform sampler2D unity_Lightmap;
uniform sampler2D _MainTex;
struct appdata_t
{
    float4 vertex :POSITION;
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
};

struct OUT_Data_Vert
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float4 tmpvar_2;
    tmpvar_2 = clamp(float4(0, 0, 0, 1.1), 0, 1);
    tmpvar_1 = tmpvar_2;
    float4 tmpvar_3;
    tmpvar_3.w = 1;
    tmpvar_3.xyz = in_v.vertex.xyz;
    out_v.xlv_COLOR0 = tmpvar_1;
    out_v.xlv_TEXCOORD0 = ((in_v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
    out_v.xlv_TEXCOORD1 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.vertex = UnityObjectToClipPos(tmpvar_3);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 col_1;
    float4 tmpvar_2;
    tmpvar_2 = UNITY_SAMPLE_TEX2D(unity_Lightmap, in_f.xlv_TEXCOORD0);
    col_1.w = tmpvar_2.w;
    col_1.xyz = (tex2D(_MainTex, in_f.xlv_TEXCOORD1) * tmpvar_2).xyz;
    col_1.xyz = (col_1 * 2).xyz;
    col_1.w = 1;
    out_f.color = col_1;
    return out_f;
}


ENDCG

}
 Pass {
  Tags { "LIGHTMODE"="VertexLMRGBM" "RenderType"="Opaque" }
  GpuProgramID 231454
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
// uniform float4 unity_LightmapST;
uniform float4 _MainTex_ST;
// uniform sampler2D unity_Lightmap;
uniform sampler2D _MainTex;
struct appdata_t
{
    float4 vertex :POSITION;
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
};

struct OUT_Data_Vert
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float4 tmpvar_2;
    tmpvar_2 = clamp(float4(0, 0, 0, 1.1), 0, 1);
    tmpvar_1 = tmpvar_2;
    float4 tmpvar_3;
    tmpvar_3.w = 1;
    tmpvar_3.xyz = in_v.vertex.xyz;
    out_v.xlv_COLOR0 = tmpvar_1;
    out_v.xlv_TEXCOORD0 = ((in_v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
    out_v.xlv_TEXCOORD1 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.vertex = UnityObjectToClipPos(tmpvar_3);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 col_1;
    float4 tmpvar_2;
    tmpvar_2 = UNITY_SAMPLE_TEX2D(unity_Lightmap, in_f.xlv_TEXCOORD0);
    col_1 = (tmpvar_2 * tmpvar_2.w);
    col_1 = (col_1 * 2);
    col_1.xyz = (tex2D(_MainTex, in_f.xlv_TEXCOORD1) * col_1).xyz;
    col_1.xyz = (col_1 * 4).xyz;
    col_1.w = 1;
    out_f.color = col_1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "SHADOWCASTER"
  Tags { "LIGHTMODE"="SHADOWCASTER" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
  Cull Off
  GpuProgramID 49029
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 unity_LightShadowBias;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
//uniform float4x4 unity_MatrixVP;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
};

struct OUT_Data_Vert
{
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 vertex :Position;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 vertex_1;
    vertex_1 = in_v.vertex.xyz;
    float4 clipPos_2;
    if((unity_LightShadowBias.z!=0))
    {
        float4 tmpvar_3;
        tmpvar_3.w = 1;
        tmpvar_3.xyz = float3(vertex_1);
        float3 tmpvar_4;
        tmpvar_4 = mul(unity_ObjectToWorld, tmpvar_3).xyz;
        float4 v_5;
        v_5.x = conv_mxt4x4_0(unity_WorldToObject).x;
        v_5.y = conv_mxt4x4_1(unity_WorldToObject).x;
        v_5.z = conv_mxt4x4_2(unity_WorldToObject).x;
        v_5.w = conv_mxt4x4_3(unity_WorldToObject).x;
        float4 v_6;
        v_6.x = conv_mxt4x4_0(unity_WorldToObject).y;
        v_6.y = conv_mxt4x4_1(unity_WorldToObject).y;
        v_6.z = conv_mxt4x4_2(unity_WorldToObject).y;
        v_6.w = conv_mxt4x4_3(unity_WorldToObject).y;
        float4 v_7;
        v_7.x = conv_mxt4x4_0(unity_WorldToObject).z;
        v_7.y = conv_mxt4x4_1(unity_WorldToObject).z;
        v_7.z = conv_mxt4x4_2(unity_WorldToObject).z;
        v_7.w = conv_mxt4x4_3(unity_WorldToObject).z;
        float3 tmpvar_8;
        tmpvar_8 = normalize((((v_5.xyz * in_v.normal.x) + (v_6.xyz * in_v.normal.y)) + (v_7.xyz * in_v.normal.z)));
        float tmpvar_9;
        tmpvar_9 = dot(tmpvar_8, normalize((_WorldSpaceLightPos0.xyz - (tmpvar_4 * _WorldSpaceLightPos0.w))));
        float4 tmpvar_10;
        tmpvar_10.w = 1;
        tmpvar_10.xyz = (tmpvar_4 - (tmpvar_8 * (unity_LightShadowBias.z * sqrt((1 - (tmpvar_9 * tmpvar_9))))));
        clipPos_2 = mul(unity_MatrixVP, tmpvar_10);
    }
    else
    {
        float4 tmpvar_11;
        tmpvar_11.w = 1;
        tmpvar_11.xyz = float3(vertex_1);
        clipPos_2 = UnityObjectToClipPos(tmpvar_11);
    }
    float4 clipPos_12;
    clipPos_12.xyw = clipPos_2.xyw;
    clipPos_12.z = (clipPos_2.z + clamp((unity_LightShadowBias.x / clipPos_2.w), 0, 1));
    clipPos_12.z = lerp(clipPos_12.z, max(clipPos_12.z, (-clipPos_2.w)), unity_LightShadowBias.y);
    out_v.vertex = clipPos_12;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    out_f.color = float4(0, 0, 0, 0);
    return out_f;
}


ENDCG

}
}
}